/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CONSOLE_H
#define CONSOLE_H

#define CONSOLE_PROGRESS_RESULT_FAILED				 0
#define CONSOLE_PROGRESS_RESULT_SUCCEEDED			1
#define CONSOLE_PROGRESS_RESULT_FAILED_ERROR	  2
#define CONSOLE_PROGRESS_RESULT_SUCCEEDED_INFO  3
#define CONSOLE_PROGRESS_RESULT_CUSTOM				 4
#define CONSOLE_PROGRESS_RESULT_UNKNOWN				5

#define CONSOLE_COLOR_BLACK							0
#define CONSOLE_COLOR_DARK_BLUE					 1
#define CONSOLE_COLOR_DARK_GREEN				  2
#define CONSOLE_COLOR_TEAL							 3
#define CONSOLE_COLOR_DARK_RED					  4
#define CONSOLE_COLOR_DARK_PURPLE				5
#define CONSOLE_COLOR_GOLD							 6
#define CONSOLE_COLOR_GREY							 7
#define CONSOLE_COLOR_DARK_WHITE				  8
#define CONSOLE_COLOR_BLUE							 9
#define CONSOLE_COLOR_GREEN						  10
#define CONSOLE_COLOR_CYAN							11
#define CONSOLE_COLOR_RED							 12
#define CONSOLE_COLOR_PURPLE						13
#define CONSOLE_COLOR_YELLOW						14
#define CONSOLE_COLOR_WHITE						  15

#define CONSOLE_COLOR_DEFAULT_FOREGROUND_COLOR		7
#define CONSOLE_COLOR_DEFAULT_BACKGROUND_COLOR		0

#define CONSOLE_QUIT_REASON_ERROR					0
#define CONSOLE_QUIT_REASON_FAILED				  1
#define CONSOLE_QUIT_REASON_SUCCEEDED			 2
#define CONSOLE_QUIT								       3

#include "Common.h"

namespace Console
{
	void InitializeGLXConsole( );
	void PrintText( __in std::string Text, __in int ForegroundColor, __in int BackgroundColor );
	void PrintProgressTable( );

	void PrintProgressInfo( __in std::string Text,
						              __in_opt int ForegroundColor = CONSOLE_COLOR_DEFAULT_FOREGROUND_COLOR,
							            __in_opt int BackgroundColor = CONSOLE_COLOR_DEFAULT_BACKGROUND_COLOR );

	void PrintProgressResult( __in int Result,
							              __in_opt std::string Text = "",
							              __in_opt int ForegroundColor = CONSOLE_COLOR_DEFAULT_FOREGROUND_COLOR,
							              __in_opt int BackgroundColor = CONSOLE_COLOR_DEFAULT_BACKGROUND_COLOR );

	void FixPrintProgressInput( __inout std::string &Input );
	void SetForegroundBackgroundColor( __in int ForegroundColor, __in int BackgroundColor );
	void ResetForegroundBackgroundColor( );
	void ClearScreen( );
	void ShowWindow( __in bool Hide );
	void GhostMode( __in bool Enable, __in int TransparencyLevel = 245 );
	void SetWindowSize( __in int X, __in int Y );
	void Quit( __in int Reason );

	BOOL EnableDebugPrivilege( __in bool Enable );
};

#endif // !CONSOLE_H